home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / Tools / Text-Viewer / Notes / english / Violinkey.file < prev    next >
Text File  |  1999-11-06  |  41KB  |  1,355 lines

  1. /* suprogram for "Notes.pprx" */
  2.  
  3. signal on halt
  4. signal on break_c
  5. signal on break_e
  6. signal on break_d
  7. call ppm_SetStyle(N)
  8. call ppm_SetMagMode(180)
  9. call ppm_UpdateScreen()
  10.  
  11.  
  12. noteneingabe:
  13.     /* smallest notedistance */
  14.     sysart = "notesystem:2"
  15.     systemart = ppm_Getform("Please repeat your choice of the notesystems... (2, 1v oder 1b)", 3, sysart)
  16.     select
  17.     when systemart == '2' then zdist = 4
  18.     when systemart == '1v' then zdist = 2
  19.     when systemart == '1b' then zdist = 2
  20.     otherwise noteneingabe()
  21.     end
  22.     zdist2 = zdist-2
  23.     xgrdform = "(1,2,4,8 oder 16)"
  24.     xgrd = ppm_GetForm("Pleace give in the smallest note distance ...(nothing=Break!)", 3, xgrdform)
  25.     if xgrd == '' then  exit_msg("Break")
  26.     select
  27.      when xgrd == '1' then xg =0.7
  28.      when xgrd == '2' then xg =1.4
  29.      when xgrd == '4' then xg =2.8
  30.      when xgrd == '8' then xg =5.6
  31.      when xgrd == '16' then xg =11.2
  32.      otherwise noteneingabe()
  33.     end
  34.  
  35.    /* pointmessure of the notes */
  36.    notepkt = 26
  37.    call ppm_SetJustification(0)
  38.    
  39.    zz = 0   /* linecounter (german:Zeilenzähler) */
  40.    notex = 3
  41.    page = ppm_CurrentPage()
  42.  
  43. pfad:
  44.    do
  45.            choose=ppm_Inform(2,"Please choose the notefile or break ...", "Break","File")
  46.            if choose == 0 then exit_msg("Break!")
  47.            eingabe = ppm_GetFileName("Pleace choose the notescriptfile ...", "Notes:")
  48.            res = OPEN(notenfile, eingabe, 'R')
  49.            if res == 0 then
  50.              do
  51.                  call ppm_inform(1,"There was an error, or the file doesn't exists!!!","OK")
  52.                  pfad()
  53.              end
  54.            call ppm_ShowStatus("OK, I'm working ...")
  55.            auslesen(notenfile)
  56.     end
  57.  
  58.     /* x-distance of the notes */
  59. auslesen:
  60.         do
  61.           parse arg file
  62.           noten = READCH(file, 4000)
  63.           i=1
  64.           do forever
  65.             nw = word(noten, i)
  66.             nn = word(noten, i+1)
  67.             al = word(noten, i+2)
  68.             if nw == 'P' then nw = 'p'
  69.             if nw == 'D' then nw = 'd'
  70.             if nw == 'C' then nw = 'c'
  71.             if nw == 'L' then nw = 'l'
  72.             if nn == 'L' then nn = 'l'          N
  73.             if nw == 'J' then nw = 'j'
  74.             if nw == 'END' then nw = 'end'
  75.             select
  76.               when al == (X2C(4e0a)) then al = 'n'
  77.               when al == (X2C(6e0a)) then al = 'n'
  78.               when al == (X2C(300a)) then al = '0'
  79.               otherwise exit_msg("There was an error!")
  80.             end
  81.             select
  82.               when nn=='GB2' then nn = 'Gb2'
  83.               when nn=='AB2' then nn = 'Ab2'
  84.               when nn=='BB2' then nn = 'Bb2'
  85.               when nn=='DB3' then nn = 'Db3'
  86.               when nn=='EB3' then nn = 'Eb3'
  87.               when nn=='GB3' then nn = 'Gb3'
  88.               when nn=='AB3' then nn = 'Ab3'
  89.               when nn=='BB3' then nn = 'Bb3'
  90.               when nn=='DB4' then nn = 'Db4'
  91.               when nn=='EB4' then nn = 'Eb4'
  92.               when nn=='GB4' then nn = 'Gb4'
  93.               when nn=='AB4' then nn = 'Ab4'
  94.               when nn=='BB4' then nn = 'Bb4'
  95.               when nn=='DB5' then nn = 'Db5'
  96.               when nn=='EB5' then nn = 'Eb5'
  97.               otherwise NOP
  98.             end
  99.             call auswahl()
  100.             i=i+3
  101.           end
  102.         end
  103.  
  104.  
  105.  
  106. auswahl:
  107.  
  108. do
  109.     select
  110.       when nw == 'j' then do
  111.                           zz = 0   /* linecounter */
  112.                           notex = 3
  113.                           return
  114.                           end
  115.       when nw == 'end' then
  116.         do
  117.             call ppm_ClearStatus()
  118.             exit_msg("Ready!")
  119.         end
  120.       when nw=='s' then
  121.           do
  122.           xw = xg/16
  123.           nw='x'
  124.           yv = 0
  125.           end
  126.       when nw=='S' then
  127.           do
  128.           xw = xg/16
  129.           nw='X'
  130.           yv = 0.47
  131.           end
  132.       when nw=='e' then
  133.           do
  134.           xw = xg/8
  135.           nw='e'
  136.           yv = 0
  137.           end
  138.       when nw=='E' then
  139.           do
  140.           xw = xg/8
  141.           nw='E'
  142.           yv = 0.47
  143.           end
  144.       when nw=='q' then
  145.           do
  146.           xw = xg/4
  147.           nw='q'
  148.           yv = 0
  149.           end
  150.       when nw=='Q' then
  151.           do
  152.           xw = xg/4
  153.           nw='Q'
  154.           yv = 0.47
  155.           end
  156.       when nw=='h' then
  157.           do
  158.           xw = xg/2
  159.           yv = 0
  160.           end
  161.       when nw=='H' then
  162.           do
  163.           xw = xg/2
  164.           yv = 0.47
  165.           end
  166.       when nw=='w' then
  167.           do
  168.           xw = xg
  169.           nw='w'
  170.           yv = 0
  171.           end
  172.       when nw=='W' then
  173.           do
  174.           xw = xg
  175.           nw='W'
  176.           yv = 0.47
  177.           end
  178.  
  179.      /* point after a note */
  180.  
  181.       when nw == 'pt' then
  182.           do
  183.             if notex < 3 then
  184.             do
  185.               notex = bakx
  186.               zz = zz - zdist
  187.               call ppm_SetSize(25)
  188.               box#id = ppm_CreateBox(notex+0.4, yw+zz+0.26-yv, 0.3, 0.9, 0)
  189.               call ppm_SetSize(20)
  190.               call ppm_TextIntoBox(box#id, 'd')
  191.             end
  192.             else
  193.             do
  194.               call ppm_SetSize(25)
  195.               box#id = ppm_CreateBox(notex-xw+0.4, yw+zz+0.26-yv, 0.3, 0.9, 0)
  196.               call ppm_SetSize(20)
  197.               call ppm_TextIntoBox(box#id, 'd')
  198.             end
  199.            select
  200.                when nn == '1' then
  201.                do
  202.                xw = xg
  203.                notex = notex+xw
  204.                end
  205.                when nn == '2' then
  206.                do
  207.                xw = xg/2
  208.                notex = notex+xw
  209.                end
  210.                when nn == '4' then
  211.                do
  212.                xw = xg/4
  213.                notex = notex+xw
  214.                end
  215.                when nn == '8' then
  216.                do
  217.                xw = xg/8
  218.                notex = notex+xw
  219.                end
  220.                when nn == '16' then
  221.                do
  222.                xw  = xg/16
  223.                notex = notex+xw
  224.                end
  225.                when nn == 'l' then
  226.                do
  227.                xw  = 0.2
  228.                notex = notex+xw
  229.                end
  230.                when nn == '0' then do
  231.                end
  232.                otherwise
  233.                do
  234.                 call ppm_ClearStatus()
  235.                 exit_msg("There was an error")
  236.                end
  237.            end
  238.            if notex >=18.7 then
  239.                do
  240.                  notex = 2.5
  241.                  zz = zz + zdist
  242.                end
  243.            return
  244.           end
  245.  
  246.       when nw == 'PT' then
  247.           do
  248.             if notex < 3 then
  249.             do
  250.               notex = bakx
  251.               zz = zz - zdist
  252.               call ppm_SetSize(25)
  253.               box#id = ppm_CreateBox(notex+0.4, yw+zz+0.26-yv, 0.3, 0.9, 0)
  254.               call ppm_SetSize(20)
  255.               call ppm_TextIntoBox(box#id, 'd')
  256.             end
  257.             else
  258.             do
  259.               call ppm_SetSize(25)
  260.               box#id = ppm_CreateBox(notex-xw+0.4, yw+zz+0.26-yv, 0.3, 0.9, 0)
  261.               call ppm_SetSize(20)
  262.               call ppm_TextIntoBox(box#id, 'd')
  263.             end
  264.            select
  265.                when nn == '1' then
  266.                do
  267.                xw = xg
  268.                notex = notex+xw
  269.                end
  270.                when nn == '2' then
  271.                do
  272.                xw = xg/2
  273.                notex = notex+xw
  274.                end
  275.                when nn == '4' then
  276.                do
  277.                xw = xg/4
  278.                notex = notex+xw
  279.                end
  280.                when nn == '8' then
  281.                do
  282.                xw = xg/8
  283.                notex = notex+xw
  284.                end
  285.                when nn == '16' then
  286.                do
  287.                xw  = xg/16
  288.                notex = notex+xw
  289.                end
  290.                when nn == 'l' then
  291.                do
  292.                xw  = 0.2
  293.                notex = notex+xw
  294.                end
  295.                when nn == '0' then
  296.                do
  297.                end
  298.                otherwise
  299.                do
  300.                 call ppm_ClearStatus()
  301.                 exit_msg("There was an error")
  302.                end
  303.            end
  304.            if notex >=18.7 then
  305.                do
  306.                  notex = 2.5
  307.                  zz = zz + zdist
  308.